#include<iostream>
using namespace std;
#include <vector>
#include <algorithm>
#include <iterator>

int main()
{
    int ary[] = {4,3,5,2,6,1};
    vector<int> vi;
    vi.assign(ary, ary+6);
    copy(vi.begin(),vi.end(), ostream_iterator<int>(cout," "));//输出到屏幕 的写法

    vi.assign(3,9); //assign 是在末尾添加元素
    copy(vi.begin(),vi.end(), ostream_iterator<int>(cout," "));

    cout<<"================================"<<endl;
    cout<<vi.at(0)<<endl;
    return 0;
}